package com.qys.livesMall.navy.controller.sys;

import com.qys.livesMall.common.result.R;
import com.qys.livesMall.framework.view.QysPage;
import com.qys.livesMall.navy.model.dto.task.*;
import com.qys.livesMall.navy.model.entity.NavyTask;
import com.qys.livesMall.navy.service.*;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 后台-水军任务

 *
 * @author
 * @since 2023-07-11
 */
@RestController
@RequestMapping("/sys/navyTask")
@Tag(name = "水军行为", description = "水军批量操作")
public class NavyTaskController {

    @Autowired
    private NavyShopCollectService navyShopCollectServer;

    @Resource
    private NavyVideoCommentService navyVideoCommentService;

    @Resource
    private NavyLivesGiveLikeService navyLivesGiveLikeService;

    @Resource
    private NavyLivesOrderService navyLivesOrderService;

    @Resource
    private NavyGoodsCommentService navyShopCommentService;

    @Resource
    private NavyLivesGiftService navyLivesGiftService;

    @Resource
    private NavyLivesBulletScreenService navyLivesBulletScreenService;


    @Resource
    private NavyShopOrderServer navyShopOrderServer;

    @Resource
    private NavyTaskService navyTaskService;

    @PostMapping("/search")
    public R<QysPage<NavyTask>> search(@RequestBody NavyTaskSearch search){
        return R.ok(navyTaskService.search(search));
    }

    /**
     * 批量收藏店铺
     * @param param
     * @return
     */
    @PostMapping("/shopCollect")
    @Operation(summary = "批量收藏店铺")
    public R shopCollect(@RequestBody AddShopCollect param){
        return navyShopCollectServer.buildTask(param);
    }


    /**
     * 批量点赞直播
     * @param param
     * @return
     */
    @PostMapping("/livesGiveLike")
    @Operation(summary = "批量点赞直播")
    public R livesGiveLike(@RequestBody AddAnchorCollect param){
        return navyLivesGiveLikeService.livesGiveLike(param);
    }

    /**
     * 批量直播下单
     * @param param
     * @return
     */
    @PostMapping("/livesOrder")
    @Operation(summary = "批量直播下单")
    public R livesOrder(@RequestBody AddLiveOrder param){
        return navyLivesOrderService.livesOrder(param);
    }

    /**
     * 批量店铺下单
     * @param param
     * @return
     */
    @PostMapping("/shopOrder")
    @Operation(summary = "批量店铺下单")
    public R shopOrder(@RequestBody AddShopOrder param){
        return navyShopOrderServer.moreShopOrder(param);
    }

    /**
     * 批量视频评论
     * @param param
     * @return
     */
    @PostMapping("/videoComment")
    @Operation(summary = "批量视频评论")
    public R videoComment(@RequestBody AddVideoComment param){
        return navyVideoCommentService.buildTask(param);
    }
    /**
     * 批量商品评论
     * @param param
     * @return
     */
    @PostMapping("/shopComment")
    @Operation(summary = "批量商品评论")
    public R goodsComment(@RequestBody AddGoodsComment param){
        return navyShopCommentService.buildTask(param);
    }

    /**
     * 批量直播礼物
     * @param param
     * @return
     */
    @PostMapping("/livesGift")
    @Operation(summary = "批量直播礼物")
    public R livesGift(@RequestBody AddLivesGift param){
        return navyLivesGiftService.buildTask(param);
    }

    /**
     * 批量直播弹幕
     * @param param
     * @return
     */
    @PostMapping("/livesBulletScreen")
    @Operation(summary = "批量直播弹幕")
    public R livesBulletScreen(@RequestBody AddLivesBulletScreen param){
        return navyLivesBulletScreenService.buildTask(param);
    }

}
